package com.lkm.app_ui.m.Imple.vip;

import android.icu.text.PluralRules;

import com.lkm.app_ui.MyApplication;
import com.lkm.app_ui.RunTimeData;
import com.lkm.app_ui.m.Imple.fun.PayCodeTask;
import com.lkm.app_ui.m.fun.DelegatePayTask;
import com.lkm.frame.task2.TaskAdapter;
import com.lkm.market2_0.entity.ResponEntity;
import com.lkm.market2_0.netapi.Api;
import com.lkm.market2_0.task.DefaultTaskExecutor;

import java.util.HashMap;
import java.util.Map;



class LoadVipTask extends TaskAdapter<Object, Object, ResponEntity<VipTo>> {

    private String cardInfo;


    public static String getTaskId(){
        return LoadVipTask.class.getName();
    }

    public LoadVipTask(String cardInfo) {
        super(new DefaultTaskExecutor(true), getTaskId(), MyApplication.getInstance().getTaskManager2());
        this.cardInfo=cardInfo;
    }

    @Override
    public void doExecuting(Object param) {
        super.doExecuting(param);

        mTaskExecutor.executor(new Runnable() {
            @Override
            public void run() {
                ResponEntity<VipTo> re = null;
                try {
                    re = ResponEntity.fromJson(
                            Api.server_get_vip("" + RunTimeData.steelyardInfo.getOrg(), RunTimeData.LoaclSteelyardMac, cardInfo, LoadVipTask.this)
                            , VipTo.class, "");
                } catch (Exception e) {
                    re = new ResponEntity().fail("刷卡失败，通讯异常");
                }

                complete(re);

            }
        });


    }
}
